home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 June: Reference Library / Dev.CD Jun 99 RL Disk 1.toast / Technical Documentation / Macintosh Technotes and Q&As / technotes / tn / MPWScripts / DisplayObsolete < prev    next >
Encoding:
Text File  |  1997-12-10  |  3.4 KB  |  98 lines  |  [TEXT/R*ch]

  1. Echo "The following file(s) are now obsolete." > "{MPW}"Obsolete.temp0;
  2. Echo "*" >> "{MPW}"Obsolete.temp0;
  3. Echo "*" >> "{MPW}"Obsolete.temp0;
  4. Echo "*" >> "{MPW}"Obsolete.temp0;
  5.  
  6. If `Exists "{MPW}:Interfaces&Libraries:"` 
  7.     Set InterfacesandLibrariesLocation "{MPW}:Interfaces&Libraries:"
  8. Else
  9.     Set InterfacesandLibrariesLocation "{MPW}"
  10. End
  11.  
  12. Set CurrentDirectory `Directory`
  13.  
  14. For j in `Files -f -d "{InterfacesandLibrariesLocation}Libraries:"`
  15.     Set Count 0
  16.     Set FieldCount 0
  17.     Directory "{j}"
  18.     For i in `Files -n -o -t TEXT -x d "{j}"`
  19.         If {FieldCount} == 0
  20.             Evaluate Exit = 0
  21.             Search /obsolete/ "{i}" -q >> Dev:Null
  22.             If {Status} == 0
  23.                 Echo {i} "is now obsolete." >> "{MPW}"Obsolete.temp0;
  24.                 Evaluate Count += 1
  25.             End;
  26.         End;
  27.         Evaluate FieldCount += 1
  28.         If {FieldCount} == 4
  29.             Evaluate FieldCount = 0
  30.         End
  31.     End;
  32.     If {Count} == 0
  33.         Echo "¶nThere are no obsolete files in" "{j}¶n¶n" >> "{MPW}"Obsolete.temp0;
  34.     Else If {Count} == 1
  35.         Echo "¶nThere is one obsolete file in " "{j}¶n¶n" >> "{MPW}"Obsolete.temp0;
  36.     Else
  37.         Echo "¶nIn" "{j}" "there are" {Count} "obsolete files¶n¶n" >> "{MPW}"Obsolete.temp0;
  38.     End;
  39. End;
  40.  
  41. Set Count 0
  42. Set FieldCount 0
  43. Directory "{MPW}Tools:"
  44. For i in `Files -n -o -t TEXT -x d "{MPW}Tools:"`
  45.     If {FieldCount} == 0
  46.         Evaluate Exit = 0
  47.         Search /MPW Archive Read Me/ "{i}" -q >> Dev:Null
  48.         If {Status} == 0
  49.             Echo {i} "is now obsolete." >> "{MPW}"Obsolete.temp2;
  50.             Evaluate Count += 1
  51.         Else
  52.             Search /no longer supported/ "{i}" -q >> Dev:Null
  53.             If {Status} == 0
  54.                 Echo {i} "is now obsolete." >> "{MPW}"Obsolete.temp2;
  55.                 Evaluate Count += 1
  56.             Else
  57.                 Search /obsolete/ "{i}" -q >> Dev:Null
  58.                 If {Status} == 0
  59.                     Echo {i} "is now obsolete." >> "{MPW}"Obsolete.temp2;
  60.                     Evaluate Count += 1
  61.                 End;
  62.             End;
  63.         End;
  64.     End;
  65.     Evaluate FieldCount += 1
  66.     If {FieldCount} == 4
  67.         Evaluate FieldCount = 0
  68.     End;
  69. End;
  70.  
  71. If {Count} == 0
  72.     Echo "¶nThere are no obsolete tools in" "{MPW}Tools:¶n¶n" >> "{MPW}"Obsolete.temp2;
  73. Else If {Count} == 1
  74.     Echo "¶nThere is one obsolete tool in " "{MPW}Tools:¶n¶n" >> "{MPW}"Obsolete.temp2;
  75. Else
  76.     Echo "¶nIn" "{MPW}Tools:" "there are" {Count} "obsolete tools¶n¶n" >> "{MPW}"Obsolete.temp2;
  77. End;
  78.  
  79. If {Count} > 0
  80.     Echo "¶nThe following tool(s) are now obsolete, but may be found in E.T.O.:Past&Future:Archive" >> "{MPW}"Obsolete.temp1;
  81.     Echo " " >> "{MPW}"Obsolete.temp1;
  82.     Echo "The 'MPW Archive' folder is a repository for MPW tools and related items which are no" >> "{MPW}"Obsolete.temp1;
  83.     Echo "longer supported and whose use is no longer recommended. While the intent is that" >> "{MPW}"Obsolete.temp1;
  84.     Echo "someday these tools will disappear from ETO altogether, it is recognized that some" >> "{MPW}"Obsolete.temp1;
  85.     Echo "developers may need more time before they are ready to transition to newer tools." >> "{MPW}"Obsolete.temp1;
  86.     Echo " " >> "{MPW}"Obsolete.temp1;
  87. End;
  88.  
  89. Catenate "{MPW}"Obsolete.temp0 "{MPW}"Obsolete.temp1 "{MPW}"Obsolete.temp2 > "{MPW}"Obsolete.index
  90. Delete -y "{MPW}"Obsolete.temp0 "{MPW}"Obsolete.temp1 "{MPW}"Obsolete.temp2
  91.  
  92. Echo "¶n" >> "{MPW}"Obsolete.index;
  93. Echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> "{MPW}"Obsolete.index;
  94. Echo "=- An obsoleted file may contain information about which object file/tool replaces it. -=" >> "{MPW}"Obsolete.index;
  95. Echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> "{MPW}"Obsolete.index;
  96.  
  97. Directory "{CurrentDirectory}"
  98.